package com.googlecode.wicketcharts.highcharts.options;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;

/**
 * Defines the configuration of the "series" option.
 * 
 * http://api.highcharts.com/highcharts#series
 * 
 * @author Tom Hombergs (tom.hombergs@gmail.com)
 * 
 */
public abstract class SeriesOptions<D> extends JsonObject {

	private static final long serialVersionUID = 1L;

	private String name;

	private SeriesType type;

	private List<D> data;

	private Integer legendIndex;

	private String stack;

	private Integer xAxis;

	private Integer yAxis;

	private Marker marker;

	private Integer size;

	private Boolean showInLegend;

	private DataLabels dataLabels;

	private Color color;
	
	private Center center;

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public Marker getMarker() {
		return marker;
	}

	public void setMarker(Marker marker) {
		this.marker = marker;
	}

	public Integer getSize() {
		return size;
	}

	public void setSize(Integer size) {
		this.size = size;
	}

	public Boolean getShowInLegend() {
		return showInLegend;
	}

	public void setShowInLegend(Boolean showInLegend) {
		this.showInLegend = showInLegend;
	}

	public DataLabels getDataLabels() {
		return dataLabels;
	}

	public void setDataLabels(DataLabels dataLabels) {
		this.dataLabels = dataLabels;
	}

	public Integer getLegendIndex() {
		return legendIndex;
	}

	public void setLegendIndex(Integer legendIndex) {
		this.legendIndex = legendIndex;
	}

	public String getStack() {
		return stack;
	}

	public void setStack(String stack) {
		this.stack = stack;
	}

	public Integer getxAxis() {
		return xAxis;
	}

	public void setxAxis(Integer xAxis) {
		this.xAxis = xAxis;
	}

	public Integer getyAxis() {
		return yAxis;
	}

	public void setyAxis(Integer yAxis) {
		this.yAxis = yAxis;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setType(SeriesType type) {
		this.type = type;
	}

	public SeriesType getType() {
		return type;
	}

	public void setData(List<D> data) {
		this.data = data;
	}

	public List<D> getData() {
		return data;
	}

	/**
	 * Adds a point to this series.
	 * 
	 * @param point
	 *            the point to add.
	 */
	public void addPoint(D point) {
		if (this.data == null) {
			this.data = new ArrayList<D>();
		}
		data.add(point);
	}

	public void setCenter(Center center) {
		this.center = center;
	}

	public Center getCenter() {
		return center;
	}

}
